﻿<%@ Page Title="" Language="VB" MasterPageFile="~/KYC/MasterPageKYC.master" AutoEventWireup="false" CodeFile="NonIndividualSearch.aspx.vb" Inherits="KYC_NonIndividualSearch" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="../Scripts/JScript.js" type="text/javascript"></script>  
<script type="text/javascript">

    $(document).ready(function () {
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        $("input[id$=btnAdd]").click(function () {
            window.open('NonIndividualCDD_Old.aspx?BIZCODE=' + $("input[id$=txtBizCode]").val()
                + '&NAMETH=' + $("input[id$=txtNameTH]").val()
                + '&NAMEEN=' + $("input[id$=txtNameEN]").val()
                + '&TypeKYC=1'
                , '_self');
        });
        $("input[id$=txtStartDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
            yearAddToDisplay: 543,
            dateFormat: 'dd/mm/yy',
            showOn: "button",
            buttonImage: "../img/calendar.gif",
            buttonImageOnly: true
        }));
        $("input[id$=txtEndDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
            yearAddToDisplay: 543,
            dateFormat: 'dd/mm/yy',
            showOn: "button",
            buttonImage: "../img/calendar.gif",
            buttonImageOnly: true
        }));
        function EndRequestHandler(sender, args) {
            $("input[id$=btnAdd]").click(function () {
                window.open('NonIndividualCDD.aspx?BIZCODE=' + $("input[id$=txtBizCode]").val()
                + '&NAMETH=' + $("input[id$=txtNameTH]").val()
                + '&NAMEEN=' + $("input[id$=txtNameEN]").val()
                + '&TypeKYC=1'
                , '_self');
            });
            $("input[id$=txtStartDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                yearAddToDisplay: 543,
                dateFormat: 'dd/mm/yy',
                showOn: "button",
                buttonImage: "../img/calendar.gif",
                buttonImageOnly: true
            }));
            $("input[id$=txtEndDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                yearAddToDisplay: 543,
                dateFormat: 'dd/mm/yy',
                showOn: "button",
                buttonImage: "../img/calendar.gif",
                buttonImageOnly: true
            }));
        }
    });

    var hasSubmitted = 0;
    function NoDoubleSubmit() {
        var divMsg = document.getElementById('Processing');
        if (hasSubmitted == 0) {
            hasSubmitted = 0;
            divMsg.style.display = 'block';
            return true;
        }
        return false;
    }



    var prm = Sys.WebForms.PageRequestManager.getInstance();

    prm.add_initializeRequest(InitializeRequest);
    prm.add_endRequest(EndRequest);

    function InitializeRequest(sender, args) {
        $get('ContentPlaceHolder1_UpdatePanel1').style.cursor = 'wait';
    }

    function EndRequest(sender, args) {
        $get('ContentPlaceHolder1_UpdatePanel1').style.cursor = 'auto';
    }

   </script>


 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
<table style="width:100%;">
            <tr>
                <td colspan="6" style="text-align: left">
                    <asp:CheckBox ID="chkType" runat="server" Checked="True" CssClass="control" 
                        Enabled="False" Font-Bold="True" ForeColor="#FF850E" />
                    &nbsp;<asp:CheckBox ID="chkUser" runat="server" CssClass="control" 
                        Text="ข้อมูลที่ปรับปรุงโดยผู้ใช้งาน" />
                         &nbsp;ตั้งแต่วันที่&nbsp;<asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox>
                    &nbsp;ถึง
                    <asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>
                    &nbsp;<asp:Label ID="lblBranch" runat="server" Visible="False">ส่วนงาน/สาขา</asp:Label>
                    <asp:DropDownList ID="ddlBranch" runat="server" CssClass="control" 
                        Visible="False" Width="200px">
                    </asp:DropDownList>
                </td>
            </tr>
             <tr>
                <td style="width: 16%; text-align: right;">
                    <g id="4ac45b0ff4a047c6bf377372fdfac7ca0" p:def="Evolus.Common:PlainTextV2" 
                        p:type="Shape" transform="matrix(1,0,0,1,296,152)" 
                        xmlns="http://www.w3.org/2000/svg" 
                        xmlns:p="http://www.evolus.vn/Namespace/Pencil">
                        <p:metadata><p:property name="disabled"><![CDATA[false]]></p:property>
                        <p:property name="width"><![CDATA[100,0]]></p:property>
                        <p:property name="fixedWidth"><![CDATA[false]]></p:property>
                        <p:property name="label"><![CDATA[เลขประจำตัวลูกค้า (CIF)]]></p:property>
                        <p:property name="textColor"><![CDATA[#000000FF]]></p:property>
                        <p:property name="textFont"><![CDATA[Microsoft Sans Serif|normal|normal|12px|none]]></p:property>
                        <p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
                        <rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" 
                            p:name="bgRect" id="e1e0b68ddb9b4f6bbb97340c9bdba7df0" width="0" 
                            height="0"/>
                        เลขประจำตัวลูกค้า
                        <br />
                    </g>
                    <strong style="font-size: 10px">CIF Number</strong><br />
                    </td>
                <td style="text-align: left; width: 134px;">
                    <asp:TextBox ID="txtCIF_NO" runat="server" AutoCompleteType="Disabled" 
                        CssClass="control" Height="20px" Width="160px"></asp:TextBox>
                </td>
                <td style="width: 16%; text-align: right;">
                   
                    <asp:TextBox ID="txtCustCode" runat="server" AutoCompleteType="Disabled" 
                        CssClass="control" Height="20px" MaxLength="20" Visible="False" Width="160px"></asp:TextBox>
                 </td>
                <td>
                   
                    <asp:DropDownList ID="DropDownList1" runat="server" Visible="False" 
                        Width="160px">
                    </asp:DropDownList>
                 </td>
                <td style="width: 16%; text-align: right;">
                  
                    &nbsp;</td>
                <td>
                   
                    &nbsp;</td>
            </tr>

            <tr>
                <td style="width: 22%; text-align: right;">
                    <asp:Label ID="lblBizCode" runat="server"></asp:Label>
                    <br />
                    <strong style="font-size: 10px">Juristic Identification Number</strong></td>
                <td style="text-align: left; width: 134px;">
                    <asp:TextBox ID="txtBizCode" runat="server" AutoCompleteType="Disabled" 
                        CssClass="control" Height="20px" MaxLength="20" Width="160px"></asp:TextBox>
                </td>
                <td style="width: 16%; text-align: right;">
                    เลขประจำตัวผู้เสียภาษีอากร<br /> <strong style="font-size: 10px">Tax 
                    Identification Number</strong></td>
                <td>
                    <asp:TextBox ID="txtTAX_ID" runat="server" MaxLength="13" Width="160px" 
                        onkeypress="javascript:return NumberOnly(event);"></asp:TextBox>
                </td>
                <td style="width: 16%; text-align: right;">
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td style="width: 22%; text-align: right;">
                    เลขที่เอกสารสำคัญ<br /> <strong style="font-size: 10px">English Word</strong></td>
                <td style="text-align: left; width: 134px;">
                    <asp:TextBox ID="txtTYPEEVIDENCE_NO" runat="server" MaxLength="21" 
                        Width="160px"></asp:TextBox>
                </td>
                <td style="width: 16%; text-align: right;">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td style="width: 16%; text-align: right;">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td style="width: 22%; text-align: right;">
                    <asp:Label ID="lblNameTH" runat="server"></asp:Label>
                    <br />
                    <strong style="font-size: 10px">English Word</strong></td>
                <td style="text-align: left; width: 134px;">
                    <asp:TextBox ID="txtNameTH" runat="server" AutoCompleteType="Disabled" 
                        CssClass="control" Height="20px" MaxLength="150" Width="200px"></asp:TextBox>
                </td>
                <td style="width: 16%; text-align: right;">
                    <asp:Label ID="lblNameEN" runat="server"></asp:Label>
                    <br />
                    <strong style="font-size: 10px">English Word</strong></td>
                <td style="text-align: left">
                    <asp:TextBox ID="txtNameEN" runat="server" AutoCompleteType="Disabled" 
                        CssClass="control" Height="20px" MaxLength="150" Width="200px" onkeypress="javascript:return EngOnly(event);"></asp:TextBox>
                </td>
                <td style="width: 16%; text-align: right;">
                    &nbsp;</td>
                <td style="text-align: left">
                    &nbsp;</td>
            </tr>

            <tr>
                <td colspan="6" style="text-align: right;">
                 <asp:Button ID="btnSearch" runat="server" CssClass="control" Text="ค้นหา (1)" 
                         Width="135px" />
                     <asp:Button ID="btnKYC" runat="server" CssClass="control" 
                         Text="พิมพ์ฟอร์ม KYC (2)" Width="135px" />
                     <asp:Button ID="btnPrintD" runat="server" CssClass="control" 
                         Text="พิมพ์ฟอร์มเงินฝาก (2)" Visible="False" Width="135px" />
                     <asp:Button ID="btnPrintL" runat="server" CssClass="control" 
                         Text="พิมพ์ฟอร์มสินเชื่อ (2)" Visible="False" Width="135px" />
                     <asp:Button ID="btnPrintP" runat="server" CssClass="control" 
                         Text="พิมพ์ฟอร์มตั๋วฯ (2)" Visible="False" Width="135px" />
                     <asp:Button ID="btnAdd" runat="server" CssClass="control" Enabled="False" 
                         Text="เพิ่ม KYC (3)" Width="135px" />
                     <asp:Button ID="btnAddOld" runat="server" CssClass="control" 
                         Text="ประเมินความเสี่ยง (3)" visible="False" Width="135px" />
                     <asp:Button ID="btnEdit" runat="server" CssClass="control" Text="ข้อมูล KYC (4)" 
                        Width="135px" Visible="False" />   
                     <asp:Button ID="btnShow" runat="server" CssClass="control" Text="ข้อมูล KYC (3)" 
                        Width="135px" Visible="False" />
                     <asp:Button ID="btnCancel" runat="server" CssClass="control" Text="เคลียร์" 
                         Width="135px" />
                </td>
            </tr>
            <tr>
                <td colspan="6" style="text-align: center">
                <asp:Label ID="lblMsg" runat="server" ForeColor="Red" Text="ไม่พบข้อมูล" 
                        Font-Bold="True" Font-Size="30px" Height="30px" Visible="False"></asp:Label>
 <SPAN id="Processing" style="DISPLAY: none">
 <img src="../img/icon/ajax-loader.gif" alt="Please wait" />
            กรุณารอสักครู่ ระบบกำลังค้นหาข้อมูล...
  </SPAN>
                    <asp:GridView ID="grdNonIndividual" runat="server" CellPadding="4" 
                        ForeColor="#333333" AutoGenerateColumns="False" Width="100%"
                        AllowPaging="True">
                        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                        <Columns>
                            <asp:BoundField DataField="CUSTSEQ" HeaderText="รหัส" > 
                            </asp:BoundField>
                            <asp:CommandField ButtonType="Image" 
                                SelectImageUrl="~/img/icon/select_icon.gif" ShowSelectButton="True">
                            <ItemStyle Width="60px" />
                            </asp:CommandField>

                                    <asp:TemplateField HeaderText="">
                                        <ItemTemplate>
                                        <asp:Button ID="btDetail" runat="server" 
                                        Text="ข้อสังเกตุ" Width="90" 
                                        CommandName="Acc_Import" 
                                        CommandArgument="<%#Ctype(Container,GridViewRow).RowIndex%>" />                                                 
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" Width="80px" />
                                   </asp:TemplateField>

                                 <asp:TemplateField HeaderText="CIF NO. CBS/FDR/NPA">
                                    <ItemTemplate>
                                        <%--<asp:Label ID="lblCustCode" runat="server" Text='<%# iif(Eval("TRANTYPE")=2,"BO",iif(Eval("TRANTYPE")=3,"ผู้จัดการกองทุน",iif(Eval("TRANTYPE")=4,"ผู้ถือหุ้น",(Eval("CUSTCODE"))))) %>'></asp:Label>--%>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Eval("CIF_CBS_NO") & " / " & Eval("CIF_FDR_NO") & " / " & Eval("CIF_NPA_NO") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle Width="10%" />
                                </asp:TemplateField>
<%--
                            <asp:BoundField HeaderText="เลขทะเบียนนิติบุคคล" DataField="UNIQUEID" >
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle Width="13%" />
                            </asp:BoundField>
--%>                        
                                <asp:TemplateField HeaderText="Registration Number/Tax Identification Number/Other Identity Document Number">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemTemplate>
                                    <asp:Label ID="lblUNIQUEID" runat="server" Text='<%# Eval("UNIQUEID") %>'></asp:Label><br />
                                    <asp:Label ID="lblTAX_ID" runat="server" Text='<%# Eval("TAX_ID") %>'></asp:Label><br />
                                    <asp:Label ID="lblTYPEEVIDENCE_NO" runat="server" Text='<%# Eval("TYPEEVIDENCE_NO") %>'></asp:Label>    
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" Width="18%" />
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Customer Name">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemTemplate>
                                    <asp:Label ID="lblTHName" runat="server" Text='<%# Eval("THFIRSTNAME") %>'></asp:Label><br />
                                    <asp:Label ID="lblENName_1" runat="server" Text='<%# Eval("ENFIRSTNAME") %>'></asp:Label>    
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" Width="18%" />
                                </asp:TemplateField>
                                
                            <asp:BoundField HeaderText="ชื่อลูกค้า (อังกฤษ)" 
                                HeaderStyle-CssClass="hidden" 
                                ItemStyle-CssClass="hidden" 
                                DataField="ENFIRSTNAME" >
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left" Width="18%" />
                            </asp:BoundField>

                                 <asp:TemplateField HeaderText="Risk Level / Syn Status / KYC Inf Status">
                                    <ItemTemplate>
                                        <asp:Label ID="lblRiskLevel" runat="server" Text='<%# Eval("AMLCDD") %>'></asp:Label>
                                        <asp:Label ID="Label2" runat="server" Text=" / "></asp:Label>
                                        <asp:Label ID="lblEtlStatus" runat="server" Text='<%# Eval("ETL_STATUS") %>'></asp:Label>
                                        <asp:Label ID="Label3" runat="server" Text=" / "></asp:Label>
                                        <asp:Label ID="lblCustCompleteFlag" runat="server" Text='<%# Eval("CUST_COMPLETE_FLAG") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                            <asp:BoundField DataField="AMLCDDOVERVIEW" 
                                HeaderText="ระดับ"
                                HeaderStyle-CssClass="hidden" 
                                ItemStyle-CssClass="hidden"/>
                           
                            <asp:TemplateField HeaderText="ระดับ / สถานะ"
                            HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden">

                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" 
                                Text='<%# eval("AMLCDD") & " / " & eval("ETL_STATUS") %>'></asp:Label>
                            </ItemTemplate>

                            </asp:TemplateField>
                            <asp:BoundField HeaderText="D W S" DataField="DEPD" >
                            <HeaderStyle HorizontalAlign="Center" Width="5px" />
                            <ItemStyle Width="5px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="L O S" DataField="DEPL" >
                            <HeaderStyle HorizontalAlign="Center" Width="5px" />
                            <ItemStyle Width="5px" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="F D R" DataField="DEPP">
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" Width="5px" />
                            <ItemStyle Width="5px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DEPN" HeaderText="N P A">
                            <HeaderStyle Width="5px" />
                            <ItemStyle Width="5px" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="Last Update">
                                <ItemTemplate>
                                    <asp:Label ID="lblUpdateDate" runat="server" Text='<%# Eval("UPDATEDATE") %>'></asp:Label>
                                    <asp:Label ID="lblDepUpdate" runat="server" 
                                        Text='<%# "(" & Eval("DEPUPDATE") & ")" %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Update By">
                                <ItemTemplate>
                                    <asp:Label ID="lblUpdateBy" runat="server" Text='<%# Eval("UpdateBy") %>'></asp:Label>
                                    &nbsp;/
                                    <asp:Label ID="lblBranchCode" runat="server" Text='<%# Eval("BranchCode") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="CUSTOMER_OWNER" HeaderText="Customer Owner" />
                            <asp:BoundField DataField="NEXT_REVIEW" HeaderText="Next Review" DataFormatString="{0:d}" />
                        </Columns>
                        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <PagerSettings Mode="NumericFirstLast" />
                        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" 
                    CssClass="cssPager" />
                        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                        <HeaderStyle BackColor="#FF9933" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        <div align="right">
                   <asp:Label ID="lblTotal" runat="server" Font-Bold="True" ForeColor="#003300"></asp:Label>
             </div>

   </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

